home *** CD-ROM | disk | FTP | other *** search
/ Nebula 2 / Nebula Two.iso / NextAnswers / 1171_document_folder_packages.rtf < prev    next >
Text File  |  1995-06-12  |  2KB  |  28 lines

  1. {\rtf0\ansi{\fonttbl\f0\fnil Times-Roman;\f1\fmodern Ohlfs;}
  2. \paperw11300
  3. \paperh7840
  4. \margl120
  5. \margr120
  6. {\colortbl;\red0\green0\blue0;\red84\green84\blue84;}
  7. \pard\tx960\tx1920\tx2880\tx3840\tx4800\tx5760\tx6720\tx7680\tx8640\tx9600\f0\b0\i0\ulnone\fs28\fc0\cf0 Q:  Is there a way to make a .wn-style document file package, so it appears to the user as a file rather than a directory? \
  8. \
  9. A:  A file package is a special kind of directory containing a set of related files that usually aren't accessed individually.  You can use a file package to hold a collection of files that make up one complete document, such as the text of a document and its imbedded graphic files.  A file package provides a convenient way to shield the files related to the application from the user; the package acts as though it were one document.  The Workspace Manager represents the package in the File Viewer by the document icon, and the Open command launches the application and opens the file rather than opening the directory.  \
  10. \
  11.  
  12. \fc1\cf1 It is easy to make your own document file package, because a file package is simply a directory which ends with the extension your application claims for its documents.  In the InterfaceBuilder Project Attributes Inspector, you can associate a custom document icon with a file name extension.  (For Release 3, use the Attributes display in Project Builder.)  When you create a directory with that extension, the Workspace Manager displays it using your custom icon instead of the folder icon.  When a user double-clicks that icon, it launches your program and requests that it open that document/directory.  \
  13. \
  14. When opening a document, your application should stat the file pathname to determine whether it is a file or a directory.  If it is a directory, you should probably open particular files within the directory and put together the complete document.  As an example, when WriteNow is opening a document package, it looks inside the directory for the file “WNDocument.wn”.  This file contains the text of the document and also has pointers to the embedded graphic files which are also stored in the file package.\
  15. \
  16. See also: \
  17. \
  18.  
  19. \b ../NEXTSTEP_Developer/Miscellaneous/registering_applications_with_workspace.rtf
  20. \b0 :  for information about registering your application with the Workspace.\
  21.     \
  22.  
  23. \fc0\cf0 QA701\
  24. \
  25. Valid for 1.0, 2.0, 3.0\
  26. \
  27.  
  28.